<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<c:set var="root" value="${pageContext.request.contextPath}"/>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<title>Lowin</title>
	<link rel="stylesheet" href="${root}/static/css/auth.css">
</head>

<body>
	<div class="lowin">
		<div class="lowin-brand">
			<img src="${root}/static/image/kodinger.jpg" alt="logo">
		</div>
		<div class="lowin-wrapper">
			<div class="lowin-box lowin-login">
				<div class="lowin-box-inner">
					<form id="loginform" >
						<p>用户登录</p>
						<div><span style="color: red;">${msg}</span></div>
						<div class="lowin-group">
							<label>姓名 <a href="#" class="login-back-link">登录?</a></label></label><span id="namemsg" style="color: red"></span>
							<input type="text" id="username" autocomplete="name" name="username" class="lowin-input">
						</div>
						<div class="lowin-group password-group">
							<label>密码 <a href="#" class="forgot-link">忘记密码?</a></label><span id="pswmsg" style="color: red"></span>
							<input type="password" id="password" name="password" autocomplete="current-password" class="lowin-input">
						</div>
						<button type="button" class="lowin-btn login-btn" onclick="return userlogin();">
							登入
						</button>
						<div class="text-foot">
							没有账户? <a href="${root}/registerUI" class="register-link">注册</a>
						</div>
					</form>
				</div>
			</div>
		</div>
	
		<footer class="lowin-footer">
			Design By @itskodinger. More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>
		</footer>
	</div>

	<script src="${root}/static/js/auth.js"></script>
	<%--script标签是要成对出现的<script></script>--%>
	<script src="${root}/static/jquery/jquery-2.2.4.min.js"></script>
	<script>
		/**
		 * 转发地址
		 */
		Auth.init({
			login_url: '${root}/login',
			forgot_url: '#forgot'
		});
		function userlogin() {
			 var username = $("#username").val();
			 var password = $("#password").val();
			 if (username != "")
			 {
			 	if (password != "")
			 	{
					$("#loginform").submit();
				 }else {
				 	var pswmsg = $("#pswmsg").html("密码不能为空");
				 	return false;
				 }
			 }else {
			 	var namemsg = $("#namemsg").html("用户名不能为空");
			 	return false;
			 }
		}
	</script>
</body>
</html>